function [ classes ] = naiveBayesClassifier( train, valid  )
    % classify the images using Bayes classifier algorithm
    
    % get the size of the validation matrix
    [train_vector_x, ~] = size(train);
    group_vector = [2 .* ones(train_vector_x / 3, 1); ones(train_vector_x / 3, 1); 3 .* ones(train_vector_x / 3, 1)];
    
    naive_fit = NaiveBayes.fit(train,group_vector, ...
          'dist',{'normal', 'normal', 'normal'});
      
    classes = predict(naive_fit, valid);
end